var uerMsg = orderLogin()
var lmsg = new Vue({
	el: "#Luser",
	data: {
		info: uerMsg
	},
	methods: {
		getTel(item) {
			return item
		},
		getUid(item) {
			return item
		},
		getImgUrl(item) {
			var url = 'http://114.55.145.243:8080/img/img/' + item + '.jpg'
			return url
		},
		getUserClass(item) {
			if(item == "女")
				return 'gender famale';
			if(item == "男")
				return 'gender male';
		}
	}
})
var lmsg1 = new Vue({
	el: "#Luser1",
	data: {
		info: uerMsg
	},
	methods: {
		getTel(item) {
			return item
		},
		getUid(item) {

			return item
		},
		getImgUrl(item) {
			var url = 'http://114.55.145.243:8080/img/img/' + item + '.jpg'
			return url
		},
		getUserClass(item) {
			if(item == "女")
				return 'gender famale';
			if(item == "男")
				return 'gender male';
		}
	}
})

var hty = new Vue({
	el: "#did",
	data: {
		dlist: tongyou()
	},
	methods: {
		getToghref(item) {
			var url = 'member_order_detail.html?order_id=' + item;
			//						var url = 'https://api.weixin.qq.com/cgi-bin/media/get?access_token=' + token + '&media_id=' + item;
			return url;
		}
	}
})

function orderLogin() {
	var list;
	$.ajax({
		url: "http://114.55.145.243:8080/liantu/Login/UsersServlet/loginUserById",
		//url:"http://localhost:8080/javaproject/Login",
		async: false,
		xhrFields: {
			withCredentials: true
		},
		success: function(data) {
			if(data.data) {
				$("#logining").css("width", "130px");
				$("#logining").prop("href", "member_info.html")
				$("#logining").html(data.data.user_tel);
				list = data.data
			} else
				alert(data.msg)
		},
		dataType: "json"
	})
	return list
}

function tongyou() {
	var status;
	var uid=$("#uid").html()
	$.ajax({
		url: "http://114.55.145.243:8080/liantu/Login/UsersServlet/getUserById",
		xhrFields: {
			withCredentials: true
		},
		async: false,
		data:{user_id:uid},
		success: function(data) {
			if(data.status) {
				status=data.data.user_dis
			} else
				alert(data.msg)
		},
		dataType: "json"
	})
	
	return getOrder(uid)
}
function getOrder(uid){
	var olist;
	
	$.ajax({
		url: "http://114.55.145.243:8080/liantu/TogetherServlet/getTogetherByUid",
		xhrFields: {
			withCredentials: true
		},
		async: false,
		data:{tog_uid:uid},
		success: function(data) {
			if(data.status) {
				olist=data.data
			} else
				alert(data.msg)
		},
		dataType: "json"
	})
	return olist
}
